
/**
 * The class Item creates an Item object that extends FixedEnt
 * 
 * @author 
 * @version     0.01
 */
import java.awt.*;
import java.awt.geom.*;
public class Item extends FixedEnt implements StepInterface
{
    // instance variables - replace the example below with your own
    private Point2D.Double myCoord;
    private char mySymbolA;
    private char mySymbolB;
    private int strength; //Amount of damage this entity deals
    private int speed;
    private boolean flash;

    /**
     * Constructor for objects of class Item
     */
    public Item(char symbol, char symbol2, int coordX, int coordY)
    {
        // initialise instance variables
        super(symbol, coordX, coordY);
        Grid.addEnt(this);
        mySymbolA = symbol;
        mySymbolB = symbol2;
    }
    
    /**
     * The add method will add an item to the players inventory
     *
     * @pre     player must be constructed
     * @param   none
     * @return  void
     * @post    item must be deconstructed
     */
    public void add()
    {
        remove();
    }


     /**
     * Preform actions every timer tick
     * 
     * @pre     object must be initialized     
     * @param   none
     * @return  none
     * @post    none    
     */
    public void step(){
        flash = !flash;
        if (flash){
            mySymbol = mySymbolB;
        }
        else{
            mySymbol = mySymbolA;
        }
    }

}
